<?php

namespace Labirynt\CmsBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;

class UserAdmin extends BaseUserAdmin
{
	protected function configureListFields(ListMapper $listMapper)
	{
		$listMapper
		->addIdentifier('username')
		->add('email')
		->add('enabled', null, array('editable' => true))
		->add('locked', null, array('editable' => true))
		->add('createdAt')
		->add('lastLogin')
		;
	}
	
	protected function configureFormFields(FormMapper $formMapper)
	{
		$formMapper
		->with('General')
		->add('username')
		->add('email')
		->add('plainPassword', 'text', array('required' => false))
		->end()
		->with('Profil')
		->add('firstname', null, array('required' => false))
		->add('lastname', null, array('required' => false))
		->end()
		;
	}
	
	protected function configureDatagridFilters(DatagridMapper $filterMapper)
	{
	}
	
	public function getExportFormats()
	{
		return array();
	}
}
